from django.urls import path
from rest_framework import permissions  # 从DRF导入而不是本地permissions
from . import views
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
#router.register(r'reviews', views.ReviewViewSet, basename='review')

app_name = 'reviews'

urlpatterns = [
    path('', views.ReviewListView.as_view(), name='review-list'),
    path('create/', views.ReviewCreateView.as_view(
        permission_classes=[permissions.IsAuthenticated]  # 使用DRF的权限类
    ), name='review-create'),
    path('<int:pk>/', views.ReviewDetailView.as_view(), name='review-detail'),
    #厨师端
    path('reviews/upload_image/', views.ReviewImageUploadView.as_view(), name='review-upload-image'),
    path('reviews/<int:pk>/photos/', views.ReviewPhotoListView.as_view(), name='review-photo-list'),
    #厨师端后台部分
    path('management/', views.VDJ_ReviewManagementView.as_view(), name='review-management'),
    path('photos/<int:pk>/', views.VDJ_ReviewPhotoManagementView.as_view(), name='review-photo-management'),
]